package model

type SysOrgRole struct {
	DcModel
	OrgRoleCode string    `json:"org_role_code" gorm:"comment:组织角色编码;primaryKey;"`
	OrgCode     string    `json:"org_code" gorm:"comment:部门编码;not null;index;"`
	Org         SysOrg    `json:"org" gorm:"foreignKey:OrgCode;references:OrgCode"` //OrgRole belongs to Org
	RoleCode    string    `json:"role_code" gorm:"comment:角色编码;not null;index;"`
	Role        SysRole   `json:"role" gorm:"foreignKey:RoleCode;references:RoleCode"` //OrgRole belongs to Role
	User        []SysUser `json:"empee_acct" gorm:"many2many:sys_user_org_role;foreignKey:OrgRoleCode;joinForeignKey:OrgRoleCode;references:EmpeeAcct;joinReferences:EmpeeAcct;"`
}

type RequestOrgRoleCode struct {
	OrgRoleCode string `json:"org_role_code"`
}

type RequestOrgRoleEdit struct {
	OrgCode  string   `json:"org_code"`
	RoleCode []string `json:"role_code"`
}
